1. Field
The following description relates to an apparatus and method for tracing memory access information.
2. Description of the Related Art
Various types of programs are executed on equipment such as computers, mobile phones, and smart phones. In executing a program, the program may be assigned a predetermined portion of memory. For example, a program may need to access a predetermined region of memory to perform execution. In this example, a memory access related error may occur.
An example of the memory access related error is a buffer overflow. A memory region allocated for a program may be specified by a predetermined pointer. If an operation error occurs in the indicator, the indicator may point to another region other than the allocated region, resulting in the buffer overflow.
The memory access related error may cause unexpected operation during the execution of a program. In this regard, many studies have been conducted on a method of tracing memory access information of a program to detect a memory access related error.
For example, to trace memory access information, a predetermined instruction function used to extract memory access information may be inserted into a source code or a binary code of a program. In this scheme, all memory regions accessed by a program are traced and the memory access related error may be easily detected. However, because memory regions other than a memory region of interest are traced, the amount of collected information is unnecessarily increased.
As another example of a method of tracing memory access information, a page fault exception may be used. In this scheme, when a program accesses a memory region and a page fault occurs, only the memory region corresponding to the page fault is traced. Therefore, the memory access of a program is traced with a small amount of access information being collected. However, while the exception is being processed, the program stops operation. As a result, a normal execution of the program cannot be guaranteed.